/*
 * @Description:
 * @Autor: zhangbing
 * @Date: 2021-07-27 17:03:47
 * @LastEditors: zhangbing
 * @LastEditTime: 2021-07-27 22:36:13
 */

import { getData } from './requests'

export default async(store) => {
  const consName = store.state.consName
  const field = store.state.field
  const data = await getData(consName, field)
  console.log(data);

  if(data.error_code) {
    store.commit("setErrorCode", data.error_code)
  }

  store.commit('setData', data)
}
